<script type="text/javascript">
function goback()
{
	location.href = "<?php echo base_url()."index.php/products/categories"; ?>"
}
</script>
			
			<div class="block small left">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Cancellazione Categoria <?php echo $categoria->nome; ?></h2>
					<ul class="tabs">
						<li><?php echo anchor('products/categories','Torna alle Categorie'); ?></li>
					</ul>
				</div>		<!-- .block_head ends -->
				
				<div class="block_content">
					<div class="message warning">Attenzione, cancellando la categoria verranno cancellati anche tutti i prodotti al suo interno</div>

					<?php echo form_open('products/categorydelete/'. $categoria->id); ?>
					<input type="hidden" name="submitted" value="1">
					<p>
						<label>Nome:</label><br/>
						<?php echo getValue($categoria,'nome'); ?>
						<?php echo form_error('nome'); ?>
					</p>
					<p>
						<label>Descrizione:</label><br/>
						<?php echo getValue($categoria,'descrizione'); ?>
						<?php echo form_error('descrizione'); ?>
					</p>
					<p>
						<label for="visibile">Nascosto</label> 
						<?php 
							if ($categoria->nascosto == 1 )
								echo "SI";
							else
								echo "NO";
						?>
					</p>
					<hr/>
					<p>
						<input type="submit" class="submit small" value="Cancella" />
						<input type="button" class="submit small" value="Annulla" onclick="goback()" />
					</p>
					<?php form_close(); ?>
					
				</div>		<!-- .block_content ends -->
				
				<div class="bendl"></div>
				<div class="bendr"></div>
			</div>		<!-- .block ends -->


			<div class="block small right">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Prodotti in <?php echo $categoria->nome; ?></h2>
				</div>		<!-- .block_head ends -->
				
				<div class="block_content">

					<table cellpadding="0" cellspacing="0" width="100%" class="sortable">
						
							<thead>
								<tr>
									<th>&nbsp;</th>
									<th>Nome</th>
									<th>Prezzo</th>
								</tr>
							</thead>
							
							<tbody>
								<?php
								foreach ($prodotti as $row)
								{
									echo "<tr>";
									echo "<td>". img($row->thumb_url)."</td>";
									echo "<td>".$row->nome."</td>";
									echo "<td>".$row->prezzo."</td>";
									echo "</tr>";
								}
								?>
							</tbody>
							
						</table>
					
				</div>		<!-- .block_content ends -->
				
				<div class="bendl"></div>
				<div class="bendr"></div>
			</div>		<!-- .block ends -->
			